// (C) Copyright to Kevin. Applied to MIT LICENSE

#pragma once

#include "CoreMinimal.h"

#include "ChunkActor.h"
#include "IQueuedWork.h"

#include "BlockManager.h"
#include "TextureManager.h"

#include "DataStructures.h"

/**
 * 
 */
class BLOCKWORLD_API ChunkRenderTask : public IQueuedWork, FNonAbandonableTask
{
private:
	FChunkCoordinate coordinate;

	AChunkActor* source;

public:
	BlockManager* block_manager;
	TextureManager* texture_manager;

public:
	ChunkRenderTask(FChunkCoordinate coordinate, AChunkActor* source);

	~ChunkRenderTask();

	void Abandon() override;

	void DoThreadedWork() override;

	FChunkCoordinate GetChunkCoordinate();
	AChunkActor* GetSourceChunk();
};
